<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // promise默认状态及结果值
        //  state pending = 等待
        //  result undefined 默认结果值
        let p = new Promise((resolve,reject)=>{
            // resolve('ok');
            // "fulfilled" 成功

            // reject('error')
            // "rejected"

            // throw '错误';
            // let a = 123;
            // a();
        });
        console.log(p);

        p.then((value)=>{
            console.log(value);
        },(reason)=>{
            console.log(reason);
        });



    </script>
</body>
</html>